#!/bin/bash
export PATH=$PATH:/opt/android-ndk-r9d/toolchain/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/
export CROSSCOMPILE=arm-linux-androideabi-
export CFLAGS="--sysroot=/opt/android-ndk-r9d/platforms/android-19/arch-arm -pie -DTV_PROJECT"
export ENV_CFLAGS="--sysroot=/opt/android-ndk-r9d/platforms/android-19/arch-arm"
export LDFLAGS="--sysroot=/opt/android-ndk-r9d/platforms/android-19/arch-arm -pie"
export HOST=arm
export DEVNAME=tv
export HTTPS_SUPPORT=1
export USE_WOLFSSL=1
export EXEC_probe=tvProbe
export EXEC_loader=tvLoader
export EXEC_monitor=tvMonitor


if [ "$1" = "release" ]; then
	make && make release
else
	make && make tar
fi
make clean -C test && make -C test
